/*
 * KKClipableNode.h
 *
 *  Created on: 2013-9-15
 *      Author: wanghua
 */

#ifndef KKCLIPABLENODE_H_
#define KKCLIPABLENODE_H_

#include "kaka_common.h"
#include "KKNode.h"
#include "XmlUtils.h"

USING_NS_CC;

using namespace std;

class KKClipableNode: public KKNode {

protected:
	;CC_SYNTHESIZE(bool,m_clipable,Clipable)
	;CC_SYNTHESIZE(CCRect,m_clipRegion,ClipRegion)
	;CC_SYNTHESIZE(CCPoint,m_clipStart,ClipStart)
	;CC_SYNTHESIZE(CCPoint,m_clipEnd,ClipEnd)
	;CC_SYNTHESIZE(int,m_padding,Padding)
	;

protected:
	void beginClip(int& test, float* box);
	void endClip(int& test, float* box);

	virtual bool initCommonInfoWithXml(TiXmlElement* element, KKNode* parent);

public:
	KKClipableNode();
	virtual ~KKClipableNode();

	virtual void saveToXml(TiXmlElement* element);
};

#endif /* KKCLIPABLENODE_H_ */
